<template>
    <div>
        <h1>通过泛型参数来定义 props 的类型</h1>
        <p>{{ title }}</p>
        <p>{{ user }}</p>
        <p>{{ msg }}</p>
    </div>
</template>

<script lang="ts" setup>
// const props=defineProps({
//     title:String,
//     user:Object,
//     msg:String
// })
export interface Iuser {
    id?:number,
    name:string,
    age:number,
    sex:string
}
// const props=defineProps<{
//     title:string,
//     user:Iuser,
//     msg:string
// }>()
const {title='江山如此多娇',user,msg}=defineProps<{
    title:string,
    user:Iuser,
    msg:string
}>()
console.log(title,user,msg);

</script>